package osgi.list.practise.referenceBundle.Listener;

import org.springframework.osgi.service.importer.OsgiServiceLifecycleListener;
import osgi.list.practise.commonInterface.CommonPluginInterface;
import osgi.list.practise.referenceBundle.TestForTheListBundle;

import java.util.List;
import java.util.Map;

/**
 * Created by IntelliJ IDEA.
 * User: Richard
 * Date: 4/21/11
 * Time: 9:55 PM
 * To change this template use File | Settings | File Templates.
 */
public class SpringListener implements OsgiServiceLifecycleListener{

    private TestForTheListBundle services ;

    public void bind(Object list, Map map) throws Exception {
        Map testMap = map;
        Object list2 = list;
        for(CommonPluginInterface service: services.getServices()){
            service.getName();
        }
    }

    public void unbind(Object o, Map map) throws Exception {
        Map testMap = map;
        Object testObject = o;
        for(CommonPluginInterface service: services.getServices()){
            service.getName();
        }
    }

    public TestForTheListBundle getServices() {
        return services;
    }

    public void setServices(TestForTheListBundle services) {
        this.services = services;
    }
}
